const express = require('express')
const router = express.Router();

const {uploadModule, uploadHandler} = require('./router_handlers/upload');
const getPics = require('./router_handlers/getPics');
const editName = require('./router_handlers/editName');
const logoff = require('./router_handlers/logoff');
const autoLogin = require('./router_handlers/autoLogin');
const changePassword = require('./router_handlers/changePassword');
const {multerModule, reqHandler} = require('./router_handlers/setAvatar');
const delFriend = require('./router_handlers/delFriend');
const addFriend = require('./router_handlers/addFriend');
const agree = require('./router_handlers/agree');
const refuse = require('./router_handlers/refuse');
const updateMsg = require('./router_handlers/updateMsg');

router.post('/upload', uploadModule.single('file'), uploadHandler);

router.get('/getPics', getPics);

router.get('/autoLogin', autoLogin);

router.put('/rename', editName);

router.delete('/logoff', logoff);

router.put('/changePassword', changePassword);

router.post('/avatar', multerModule.single('file'), reqHandler);

router.put('/delFriend', delFriend);

router.put('/addFriend', addFriend);

router.put('/agree', agree);

router.put('/refuse', refuse);

router.put('/updateMsg', updateMsg);

module.exports = router